<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
                             "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:s="http://jboss.com/products/seam/taglib"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:h="http://java.sun.com/jsf/html"
		xmlns:ice="http://www.icesoft.com/icefaces/component" 
                template="layout/template.xhtml">
                       
<ui:define name="body">
    
    <h:messages globalOnly="true" styleClass="message" id="globalMessages"/>
    
    <ice:form id="teeeditForm" styleClass="edit">
     <ice:panelGroup  id="editteeGroupId" styleClass="formBorderHighlight">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                  <td class="iceDatTblColHdr2">
			    <ice:outputText id="editTextBoxId" value="#{teeHome.managed ? 'Edit' : 'Add'} tee"/>
                  </td>
              </tr>
          </table>

        <ice:panelGroup id="editPanelGroupId" styleClass="edit">		 


            <s:decorate id="holeIdDecoration" template="layout/edit.xhtml">
                <ui:define name="label">holeId</ui:define>
                <ice:inputText id="holeId"
                       required="true"
                       disabled="#{teeHome.managed}"
                        partialSubmit="true"
                                  value="#{teeHome.instance.id.holeId}">
                 </ice:inputText>
               </s:decorate>

            <s:decorate id="teeSetIdDecoration" template="layout/edit.xhtml">
                <ui:define name="label">teeSetId</ui:define>
                <ice:inputText id="teeSetId"
                       required="true"
                       disabled="#{teeHome.managed}"
                        partialSubmit="true"
                                  value="#{teeHome.instance.id.teeSetId}">
                 </ice:inputText>
               </s:decorate>


            <s:decorate id="distanceDecoration" template="layout/edit.xhtml">
                <ui:define name="label">distance</ui:define>
                        <ice:inputText id="distanceId"
			    partialSubmit="true"
                       required="true"
                                    value="#{teeHome.instance.distance}">
                        </ice:inputText>
            </s:decorate>


            <div style="clear:both">
                <span class="required">*</span> 
                required fields
            </div>
          </ice:panelGroup>
       </ice:panelGroup>
                  
       <div class="actionButtons">
        
            <h:commandButton id="saveteeHome" 
                          value="Save" 
                         action="#{teeHome.persist}"
                       disabled="#{!teeHome.wired}"
                       rendered="#{!teeHome.managed}"/>  
                          			  
            <h:commandButton id="updateteeHome" 
                          value="Save" 
                         action="#{teeHome.update}"
                       rendered="#{teeHome.managed}"/>
                        			  
            <h:commandButton id="deleteteeHome" 
                          value="Delete" 
                         action="#{teeHome.remove}"
                      immediate="true"
                       rendered="#{teeHome.managed}"/>
                    
            <s:button id="doneteeHome" 
                   value="Done"
             propagation="end"
                    view="/Tee.xhtml"
                rendered="#{teeHome.managed}"/>
                
            <s:button id="cancelteeHome" 
                   value="Cancel"
             propagation="end"
                    view="/#{empty teeFrom ? 'TeeList' : teeFrom}.xhtml"
                rendered="#{!teeHome.managed}"/>
                
        </div>
        
    </ice:form>

 <ice:form id="form2teeHome">  
        <ice:panelTabSet id="editPanelTabteeHomeId" styleClass="componentPanelTabSetLayout" style="margin-bottom:5px;margin-top:10px;">
   
 	<ice:panelTab id="editTabholeId" label="hole *" >
		<div class="association" id="holeParent">
    
        	<h:outputText id="editholeTextId" value="There is no hole associated with this tee." 
                   rendered="#{teeHome.instance.hole == null}"/>
       	<ice:dataTable var="hole" 
                   value="#{teeHome.instance.hole}" 
                rendered="#{teeHome.instance.hole != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
		  columnClasses="allCols"
                      id="editholeTableId">
            <ice:column id="$editColumnidId">
                <f:facet name="header">id</f:facet>
                #{hole.id}
            </ice:column>
            <ice:column id="$editColumncourseId">
	    	    <f:facet name="header">course id</f:facet>
		    	#{hole.course.id}
            </ice:column>
            <ice:column id="$editColumnladiesHandicapId">
                <f:facet name="header">ladiesHandicap</f:facet>
                #{hole.ladiesHandicap}
            </ice:column>
            <ice:column id="$editColumnladiesParId">
                <f:facet name="header">ladiesPar</f:facet>
                #{hole.ladiesPar}
            </ice:column>
            <ice:column id="$editColumnmensHandicapId">
                <f:facet name="header">mensHandicap</f:facet>
                #{hole.mensHandicap}
            </ice:column>
            <ice:column id="$editColumnmensParId">
                <f:facet name="header">mensPar</f:facet>
                #{hole.mensPar}
            </ice:column>
            <ice:column id="$editColumnnameId">
                <f:facet name="header">name</f:facet>
                #{hole.name}
            </ice:column>
            <ice:column id="$editColumnnumberId">
                <f:facet name="header">number</f:facet>
                #{hole.number}
            </ice:column>
            <ice:column id="editColumnholeLinkId">
                <f:facet name="header">action</f:facet>
                <s:link view="/Hole.xhtml" 
                         id="viewhole" 
                      value="View" 
                propagation="none">
                    <f:param name="holeId" 
                           value="#{hole.id}"/>
                </s:link>
            </ice:column>
      </ice:dataTable>
        <div class="actionButtons">
            <s:button value="Select hole"
	              id="editSelectButtonholeId"
                      view="/HoleList.xhtml">
                <f:param name="from" value="TeeEdit"/>
            </s:button>
        </div>
        
    </div>
    </ice:panelTab>
   
 	<ice:panelTab id="editTabteeSetId" label="teeSet *" >
		<div class="association" id="teeSetParent">
    
        	<h:outputText id="editteeSetTextId" value="There is no teeSet associated with this tee." 
                   rendered="#{teeHome.instance.teeSet == null}"/>
       	<ice:dataTable var="teeSet" 
                   value="#{teeHome.instance.teeSet}" 
                rendered="#{teeHome.instance.teeSet != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
		  columnClasses="allCols"
                      id="editteeSetTableId">
            <ice:column id="$editColumnidId">
                <f:facet name="header">id</f:facet>
                #{teeSet.id}
            </ice:column>
            <ice:column id="$editColumncolorId">
                <f:facet name="header">color</f:facet>
                <div title="#{teeSet.color}" style="background-color: #{teeSet.color}; height: 1em; width: 1em; outline: 1px solid black; margin: 0 auto;" />
            </ice:column>
            <ice:column id="$editColumncourseId">
	    	    <f:facet name="header">course id</f:facet>
		    	#{teeSet.course.id}
            </ice:column>
            <ice:column id="$editColumnladiesCourseRatingId">
                <f:facet name="header">ladiesCourseRating</f:facet>
                #{teeSet.ladiesCourseRating}
            </ice:column>
            <ice:column id="$editColumnladiesSlopeRatingId">
                <f:facet name="header">ladiesSlopeRating</f:facet>
                #{teeSet.ladiesSlopeRating}
            </ice:column>
            <ice:column id="$editColumnmensCourseRatingId">
                <f:facet name="header">mensCourseRating</f:facet>
                #{teeSet.mensCourseRating}
            </ice:column>
            <ice:column id="$editColumnmensSlopeRatingId">
                <f:facet name="header">mensSlopeRating</f:facet>
                #{teeSet.mensSlopeRating}
            </ice:column>
            <ice:column id="$editColumnnameId">
                <f:facet name="header">name</f:facet>
                #{teeSet.name}
            </ice:column>
            <ice:column id="$editColumnpositionId">
                <f:facet name="header">position</f:facet>
                #{teeSet.position}
            </ice:column>
            <ice:column id="editColumnteeSetLinkId">
                <f:facet name="header">action</f:facet>
                <s:link view="/TeeSet.xhtml" 
                         id="viewteeSet" 
                      value="View" 
                propagation="none">
                    <f:param name="teeSetId" 
                           value="#{teeSet.id}"/>
                </s:link>
            </ice:column>
      </ice:dataTable>
        <div class="actionButtons">
            <s:button value="Select teeSet"
	              id="editSelectButtonteeSetId"
                      view="/TeeSetList.xhtml">
                <f:param name="from" value="TeeEdit"/>
            </s:button>
        </div>
        
    </div>
    </ice:panelTab>
</ice:panelTabSet>
</ice:form>
</ui:define>

</ui:composition>



